package com.example.demo.dao;

import com.example.demo.model.Userinfo;
import com.example.demo.model.vo.UserinfoVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created with IntelliJ IDEA.
 * Description:  映射层UserMapper
 * User: yyx
 * Date: 2023-11-05
 * Time: 14:34
 */

public interface UserMapper {

    @Insert("insert into userinfo(username,password) values(#{username},#{password})")
    int reg(Userinfo userinfo);

    @Select("select * from userinfo where username = #{username}")
    Userinfo getUserByName(@Param("username")String username);

    @Select("select * from userinfo where id=#{uid}")
    UserinfoVO getUserByid(@Param("uid")int uid);
}
